Raspberry Pi 2/3

2020/12/06

Important Note.

This is about Raspberry 3, which runs the armhf architecture. See Raspberry Pie 4 for 64-bit build environments on RPi-4

Installing Raspbian

OpenCPN works on Raspberry Pi 2, 3 and 4 models. You can install OpenCPN adding an Ubuntu PPA (Personal Packages Archives) to your system's Software Sources. We will see how to do this but first of all you need to have a running system.

Raspbian is the official Operating System for Raspberry Pi. You have two options to install Raspbian on an SD card: with NOOBS (New Out Of Box Software) or installing an SD image directly. We recommend NOOBS.

Follow this easy guide for both options: https://www.raspberrypi.org/learning/software-guide/quickstart/ Then you will need to install OpenCPN Ubuntu PPA.

If you feel lazy you can try OpenPlotter, a complete marine Operating System for Raspberry Pi with OpenCPN + plugins installed and amazing extra tools ready to use.

OpenPlotter

You can download OpenPlotter as a ready-to-work SD image or install it manually on any Debian-derived system.

Apt-Key Deprecated - May 2018

See http://www.cruisersforum.com/forums/f134/opencpn-version-4-8-4-released-200246-2.html#post2627925 and the later posts from bdbcat and CaptRon. How do I fix the GPG error “NO_PUBKEY”? Apt-key is deprecated, see gpg: keyserver receive failed: No dirmngr and GPG error: http://ppa.launchpad.net precise Release: The following signatures couldn't be verified because the public key is not available

Adding OpenCPN Ubuntu PPA to Raspbian Software Sources

Once you have Raspbian running on Raspberry Pi, go to Menu → Accessories → Terminal, and type:

sudo nano /etc/apt/sources.list

A text editor will open. Move the cursor to the end and add this line and add a record for PPA repository compatible with your Rasbbian release. If you are on Raspbian Stretch, the compatible Ubuntu release is Xenial, for Raspbian Buster it is Bionic. The exactl record to add can be obtained from the Technical details section of
https://launchpad.net/~opencpn/+archive/ubuntu/opencpn and will be similar to

deb https://ppa.launchpadcontent.net/opencpn/opencpn/ubuntu focal main

Save the file pressing Ctrl X, say Yes and press enter. Now type:

sudo apt install dirmngr

(A certificate management service, needed for the next command) Then type

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys C865EB40

and press enter. Now be sure you have Internet connection and type:

sudo apt-get update

The Software sources will be updated and finally you will have to type:

sudo apt-get install opencpn

and you are done!

RPI HAT & GPS setup

See https://www.cruisersforum.com/forums/f134/rpi-hat-what-interface-for-gnss-244280.html#post3307322

For direct implementation with OpenCPN the easiest path is NMEA 0183, this is supported natively and directly by OpenCPN - no other decoding software widget would be required. O recognizes serial ports on the host directly - this is built-in functionality. On the NEO 8 NMEA is available on both the UART and USB interfaces:

UART

9600 baud, 8 bits, no parity bit, 1 stop bit. Configured to transmit both NMEA and UBX protocols, but only the following NMEA (and no UBX) messages have been activated at start-up: GGA, GLL, GSA, GSV, RMC, VTG, TXT

USB

Configured to transmit both NMEA and UBX protocols, but only the following NMEA (and no UBX) messages have been activated at start-up: GGA, GLL, GSA, GSV, RMC, VTG, TXT USB power mode: bus-powered On Linux OpenCPN should be able to access either port with built-in drivers, not much difference and not much configuration required, so whichever is easier to implement in the hat.

If, for some reason, you want to use SPI/DDC you could use the OpenPlotter installation to add some I2C support or write your own code, but that is a more difficult path for the stated purpose of integration with O (but there may be other reasons depending on alternate uses for your project).

Installing plugins

To install or update plugins, use the Plugin-Manager of openCPN. Go to Options → Plugins and update the Plugin Catalog: Master. Scroll the plugin list to find the plugin you want to install or update. A green up arrow indicates that there is an update available. Select the the plugin and install or update it. Finally, enable the plugin.

Advanced

SD Cards

It is suggested to use 'High Endurance' microSDHC cards. Google 'Wear Level' on SD cards to discover more information.

OpenGL acceleration

The latest version of Raspbian based on Debian Buster has OpenGL enabled by default if you are running it on a Raspberry 4.

Compiling OpenCPN on Raspberry Pi

https://opencpn.org/wiki/dokuwiki/doku.php?id=opencpn:developer_manual:developer_guide:compiling_linux:rpi2

Slow ENC Vector chart display